#ifndef GET_DOWNLOADERS_H
#define GET_DOWNLOADERS_H

#include "../../lib/alp_without_pool/bencode.h"
#include "../connect_tracker/connect_tracker.h"

/**
 * struct of the deownloaders-peer-info
 * there is a /0 at the ending of each char*
 */
typedef struct peer_info_t
{
	char * peer_id, * peer_ip, * peer_port;
	int peer_id_length, peer_ip_length, peer_port_length;
}peer_info_t;

/**
 * Connect the tracker-server.
 * @param node			[in]			the root node of the dictionary of the tracker-server's response
 * @param peer_num		[out]			the total number of peers
 * @return value						the pointer of the array of peer_info_t, NULL for error
 */
peer_info_t * get_downloaders(bencode_node_t * node, int * peer_num);

#endif